#include <rclcpp/rclcpp.hpp>

class NodeLog : public rclcpp::Node
{
public:
    NodeLog(std::string name) : Node(name)
    {
        RCLCPP_INFO(this->get_logger(), "This is info log...");
    }

    void timer_out()
    {
        while (1)
        {
            RCLCPP_INFO_THROTTLE(this->get_logger(), *this->get_clock(), 4000, "print info first...");
            RCLCPP_INFO_THROTTLE(this->get_logger(), *this->get_clock(), 2000, "print info second...");
            rclcpp::sleep_for(std::chrono::seconds(1));
        }
    }
};

int main(int argc, char **argv)
{
    rclcpp::init(argc, argv);
    auto node = std::make_shared<NodeLog>("test_log");
    node->timer_out();
    rclcpp::spin(node);
    rclcpp::shutdown();

    return 0;
}